package file;

import java.io.File;
import java.io.IOException;

public class CreateNewFileDemo {
    public static void main(String[] args) throws IOException {
        /*
        File file = new File("./test.txt");
        if(file.exists()){
            System.out.println("该文件已存在");

        }else {
            file.createNewFile();
            System.out.println("该文件已创建");
        }

         */
        for (int i = 0; i < 10; i++) {
            File file = new File("./test"+i+".txt");
            if(!file.exists()){
               file.createNewFile();
            }
        }
        System.out.println("创建完毕");

    }
}
